package cn.demengsite.service.impl;

import cn.demengsite.dao.ProductDAO;
import cn.demengsite.dao.VendorDAO;
import cn.demengsite.model.BaseInfo;
import cn.demengsite.model.Product;
import cn.demengsite.model.ProductImageAttr;
import cn.demengsite.model.VendorProduct;
import cn.demengsite.service.ProductService;
import cn.demengsite.service.VendorService;
import cn.demengsite.utils.ProductUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public class VendorServiceImpl implements VendorService {

    @Autowired
    private VendorDAO vendorDAO;


    @Override
    public BaseInfo getAllVendorProduct() {
        return new BaseInfo("0","OK",vendorDAO.getAllVendorProduct());
    }

    @Override
    public BaseInfo newVendorProduct(VendorProduct vendorProduct) {
        vendorDAO.newVendorProduct(vendorProduct);
        return new BaseInfo("0","ok");
    }

    @Override
    public BaseInfo updateVendorProduct(VendorProduct vendorProduct) {

        vendorDAO.updateVendorProductById(vendorProduct);
        return new BaseInfo("0","ok");

    }
}
